<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://eureka.yigolden.net/stringutils/sutaglib/1.0" prefix="su"%>
<c:set var="bookitem" value="${auction.book }" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Attach our CSS -->
<link type="text/css" href="${staticResources}/css/confirmpurchase.css" rel="stylesheet" />	
<!-- Attach necessary scripts -->
<script type="text/javascript" src="${staticResources}/js/jquery-1.4.4.min.js"></script>
<!-- <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script> -->
<script type="text/javascript" src="${staticResources}/js/jquery.reveal.js"></script>

<style type="text/css">
	body { font-family: "HelveticaNeue","Helvetica-Neue", "Helvetica", "Arial", sans-serif; }
</style>
<title>拍卖详情</title>
<link type="text/css" href="${staticResources}/css/showbook.css" rel="stylesheet" />
<script type="text/javascript" src="${staticResources}/js/ajax.js"></script>
<script type="text/javascript">
function tabextend(name){
	var dtl = document.getElementById("dtl");
	var bedes = document.getElementById("des");
	var deold = document.getElementById("old");
	var benote = document.getElementById("note");
	var bhis = document.getElementById("bhis");
	var adtl = document.getElementById("adtl");
	var ades = document.getElementById("ades");
	var aold = document.getElementById("aold");
	var anote = document.getElementById("anote");
	var abhis = document.getElementById("abhis");
	switch (name)
	{
	case 'dtl':
		adtl.style.background="#BBFFDD";
		ades.style.background="#FFFFFF";
		aold.style.background="#FFFFFF";
		anote.style.background="#FFFFFF";
		abhis.style.background="#FFFFFF";
		dtl.style.display="block";
		bedes.style.display="none";
		deold.style.display="none";
		benote.style.display="none";
		bhis.style.display="none";
		break;
	case 'des':
		adtl.style.background="#FFFFFF";
		ades.style.background="#BBFFDD";
		aold.style.background="#FFFFFF";
		anote.style.background="#FFFFFF";
		abhis.style.background="#FFFFFF";
		dtl.style.display="none";
		bedes.style.display="block";
		deold.style.display="none";
		benote.style.display="none";
		bhis.style.display="none";
		break;
	case 'old':
		adtl.style.background="#FFFFFF";
		ades.style.background="#FFFFFF";
		aold.style.background="#BBFFDD";
		anote.style.background="#FFFFFF";
		abhis.style.background="#FFFFFF";
		dtl.style.display="none";
		bedes.style.display="none";
		deold.style.display="block";
		benote.style.display="none";
		bhis.style.display="none";
		break;
	case 'note':
		adtl.style.background="#FFFFFF";
		ades.style.background="#FFFFFF";
		aold.style.background="#FFFFFF";
		anote.style.background="#BBFFDD";
		abhis.style.background="#FFFFFF";
		dtl.style.display="none";
		bedes.style.display="none";
		deold.style.display="none";
		benote.style.display="block";
		bhis.style.display="none";
		break;
	case 'bhis':
		adtl.style.background="#FFFFFF";
		ades.style.background="#FFFFFF";
		aold.style.background="#FFFFFF";
		anote.style.background="#FFFFFF";
		abhis.style.background="#BBFFDD";
		dtl.style.display="none";
		bedes.style.display="none";
		deold.style.display="none";
		benote.style.display="none";
		bhis.style.display="block";
		break;
	}
}

function loadBid() {
	document.getElementById("bid_frame").src="${contextPath }/Auctions/Bid?baid=${auction.baID }";
}
</script>
</head>
<body>

<div id="header">
  <div id="hy">
    <c:if test="${user eq null }">
    <div id="logo">欢迎光临中国药科大学二手书交易平台!请<span><a href="${contextPath }/Account/Login">登录</a></span> 免费<span><a href="${contextPath }/Account/Register">注册</a></span></div>
    </c:if>
    <c:if test="${user ne null }">
    <div id="sc">
      <ul>
        <li><a href="${contextPath }/Account/Logout">注销</a></li>
        <li><a href="${contextPath }/Me?content=201">收藏夹</a></li>
        <li><a href="${contextPath }/Me">个人中心</a></li>
        <li>欢迎你，<b>${fn:escapeXml(user.nickName) }</b>！</li>
      </ul>
    </div>
    </c:if>
    
    
  </div>
  <div id="top"><img src="${staticResources}/image/zhuye_04.gif" width="1024" height="153" alt=""></div>
  <div id="nav" style="background:url(${staticResources}/image/zhuye_06.gif)">
    <ul>
      <li><a href="${contextPath }/Homepage">首页</a></li>
      <li><a href="${contextPath }/Books/Search">交易广场</a></li>
      <li><a href="${contextPath }/Auctions/Search">拍卖中心</a></li>
      <li><a href="#">读者推荐</a></li>
      <li><a href="${contextPath }/Comment/ListComments">留言板</a></li>
      <li><a href="#">新手指南</a></li>
    </ul>
  </div>
</div>
<!--头部结束-->
<div class="main" style="margin: 0px auto; height:auto;">
     <div class="lmain" style=" height:auto;"><span><img src="${staticResources}/image/zhuye_10.gif" width="179" height="35" alt=""></span>
        <dl class="tsfl">
           <dd> <a href="#">小说 </a></dd>
           <dt><a href="#"> 言情 武侠 名著 军事 悬疑 职场</a></dt>
           <dd><a href="#"> 期刊</a></dd>
           <dt><a href="#"> 财经 漫画 英文 杂志</a></dt>
           <dd><a href="#">文学</a></dd>
           <dt><a href="#"> 诗歌 散文 文集 外国诗歌</a></dt>
           <dd><a href="#"> 教科书             </a></dd>
           <dt><a href="#">化学 物理 生物 英语 计算机 药理</a></dt>
           <dd><a href="#"> 教辅用书</a></dd>
           <dt><a href="#"> 药院 中药院 商院 生科院 理学院</a></dt>
           <dd><a href="#"> 人文社科</a></dd>
           <dt><a href="#"> 商务礼仪 宗教 历史 法律 心理学</a></dt>
           <dd><a href="#"> 艺术</a></dd>
           <dt><a href="#"> 摄影 绘画 音乐 舞蹈 书法 篆刻</a></dt>
           <dd><a href="#"> 成功励志</a></dd>
           <dt><a href="#"> 礼仪 人际交往 口才 留学 哲学</a></dt>
           <dd><a href="#"> 其他</a></dd>
           <dt><a href="#">...</a></dt>
         </dl>
         <dl class="phb">
            <span><img src="${staticResources}/image/zhuye_37.gif" width="177" height="35" alt=""></span>
            <div id="nn">
               <ul>
            <li><a href="#">教科</a></li>
            <li><a href="#">小说</a></li>
            <li><a href="#">期刊</a></li>
            <li><a href="#">其他</a></li>
               </ul>
            </div>
          <dd><a href="#"><img src="${staticResources}/image/zhuye_43.gif" width="64" height="74" alt="">书名：<br>价格：<br>卖家信息：</a>          </dd>
          <dd><a href="#"><img src="${staticResources}/image/zhuye_43.gif" width="64" height="74" alt="">书名：<br>价格：<br>卖家信息：</a>          </dd>
          <dd><a href="#"><img src="${staticResources}/image/zhuye_43.gif" width="64" height="74" alt="">书名：<br>价格：<br>卖家信息：</a>          </dd>
        </dl>
     </div>
     <div class="rmain">
        <div class="intro">
        <div class="book">
			       <div class="pic"><img src="${contextPath}/Books/GetBookPicture?beid=${bookitem.beID}&size=min" style="max-height: 340px; max-width: 270px;" alt="" /></div>
				   <div class="name">
				        <dl style="font-size:26px ;font-weight:1000">${fn:escapeXml(bookitem.name)}</dl><small><a href="ShowBasicBook?bbid=${bookitem.bbID}" style="font-size:16px;font-weight:1000">>>找同款</a></small><br>
				        <small>版本：${fn:escapeXml(bookitem.version)}</small><br>
			            <small>出版社：${fn:escapeXml(bookitem.publisher)}</small><br>
			            <small>主编：${fn:escapeXml(bookitem.chiefEditor)}</small><br>
			            <small>分类：${fn:escapeXml(bookitem.category.name)}</small><br>
			            <span style="font-size:24px ;font-weight:1000">最低竞价：</span><b style="font-size:30px;font-weight:1000">￥${fn:escapeXml(auction.biddingPrice)}</b><br>
			            <small>卖家昵称：${fn:escapeXml(bookitem.owner.nickName)}</small><br>
			            <small>新旧程度：${fn:escapeXml(bookitem.conditionFriendlyName)}</small><br>
			            <small>笔记情况：${fn:escapeXml(bookitem.hasNoteFriendlyName)}</small><br>
			            <small>发布时间：${fn:escapeXml(bookitem.formattedLastSateChangedTime)}</small><br>
				   </div>
				   <div class="botton">
				         <div class="bts">
						      <div class="b1">
						 		<a href="#" class="big-link" data-reveal-id="myModal" data-animation="fade" onclick="loadBid();"><img src="${staticResources}/image/bid_button_big.gif" width="200" height="60" alt="" /></a>
						      </div>
							  <div class="b2">
						 		<!-- <a href="#"><img src="${staticResources}/image/showbook_08.gif" width="200" height="60" alt=""></a> -->
						      </div>
						 </div>
				   </div>
			  </div>
	   </div>
	   
	   <div class="detail">
		   <div id="nav2">
		    <ul>
                <li><a href="#" onclick="tabextend('dtl');return false" id="adtl" style="background :#BBFFDD" >拍卖信息</a></li>
                <li><a href="#" onclick="tabextend('des');return false" id="ades" >卖家描述</a></li>
                <li><a href="#" onclick="tabextend('old');return false" id="aold">新旧程度</a></li>
                <li><a href="#" onclick="tabextend('note');return false" id="anote">笔记情况</a></li>
                <li><a href="#" onclick="tabextend('bhis');return false" id="abhis">竞价历史</a></li>
            </ul>
		   </div>
		   <br/>
		   <div class="con" id="dtl" style="display : block ; border-width : 1px">
		     <dl>
			    <dd style="font-size : 16px ; font-weight :900">拍卖详情</dd>
				<dt>状态:${auction.state.friendlyName }</dt>
				<dt>起拍价:${auction.startingPrice }</dt>
				<dt>最小竞拍价:${auction.minimunMarkupPrice }</dt>
				<c:choose>
				  <c:when test="${auction.currentPrice eq 0 }">
				    <dt>当前无人竞拍！</dt>
				  </c:when>
				  <c:otherwise>
				    <dt>当前价格:${auction.currentPrice }</dt>
				    <dt>竞拍者：${fn:escapeXml(auction.bidder.nickName) }</dt>
				  </c:otherwise>
				</c:choose>
				<dt>结束时间:${auction.endingDate }</dt>
			 </dl>
		   </div>
		   <div class="con" id="des" style="display : none ; border-width : 1px">
		     <dl>
			    <dd style="font-size : 16px ; font-weight :900">卖家描述</dd>
				<dt>${fn:escapeXml(bookitem.description)}</dt>
			 </dl>
			 <c:if test="${bookpics_count != null && bookpics_count gt 0}">
              <dd style="font-size : 16px ; font-weight :900">
                图片
              </dd>
              <c:forEach var="bookpic" items="${bookpics}">
               <dt>
                <img src="${userContents }/bepics/${bookpic.completeFileName}" style="max-width:800px;max-height:600px;" />
               </dt>
              </c:forEach>
			 </c:if>
		   </div>
		   <div class="con" id="old" style="display : none ; border-width : 1px">
		     <dl>
			    <dd style="font-size : 16px ; font-weight :900">新旧程度</dd>
				<dt>${fn:escapeXml(bookitem.conditionFriendlyName)}</dt>
		
			 </dl>
		   </div>
		   <div class="con" id="note" style="display : none ; border-width : 1px">
		     <dl>
			    <dd style="font-size : 16px ; font-weight :900">笔记情况</dd>
				<dt>${fn:escapeXml(bookitem.hasNoteFriendlyName)}</dt>
			 </dl>
		   </div>
		   <div class="con" id="bhis" style="display : none ; border-width : 1px">
		     <dl>
			    <dd style="font-size : 16px ; font-weight :900">竞价历史</dd>
			    <c:set var="bid_counter" value="0" />
			    <c:forEach var="eachbid" items="${bid_page.records}">
			      <dt>&nbsp;&nbsp;竞价：${eachbid.price }&nbsp;&nbsp;&nbsp;&nbsp;时间：${eachbid.biddingDate }&nbsp;&nbsp;&nbsp;&nbsp;竞价人：${fn:escapeXml(eachbid.bidder.nickName) }</dt>
			      <c:set var="bid_counter" value="${bid_counter + 1 }" />
			    </c:forEach>
			    <c:if test="${bid_counter eq 0 }">
			     <dt>当前无人竞拍！</dt>
			    </c:if>
			 </dl>
		   </div>
		   
		 <input type="hidden" name="beid" id="beid" value="${bookitem.beID}" />
		 <input type="hidden" name="redirect_url" id="redirect_url" value="${su:encodeLink(param.redirect_url) }" />  
		</div>
     </div>
     
</div>
<!--中间部分结束-->
<div id="bottom" ><img src="${staticResources}/image/zhuye_47.gif" width="1024" height="86" alt=""></div>

<div id="myModal" class="reveal-modal">
     <iframe id="bid_frame" src="" style=" width:600px; height:290px; margin:0px 0px 0px -35px;" frameBorder="0" border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes">
     </iframe>
     <a class="close-reveal-modal">&#215;</a>
</div>
</body>
</html>